<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>详情</title>
    <link rel="stylesheet" href="../../layui/css/layui.css" />
    <style>
        .layui-input {
            width: 220px;
        }
        .layui-form-item{
            margin-top: 5px;
            padding-bottom: 15px;
        }
    </style>
</head>
<body>
<form class="layui-form" action="" lay-filter="upd">
    <input type="hidden" id="lid" name="lid">
    <div class="layui-form-item">
        <label class="layui-form-label">租户姓名</label>
        <div class="layui-input-inline">
            <input type="text" name="lname" id="lname" required  lay-verify="required" placeholder="请输入单元号" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">租户电话</label>
        <div class="layui-input-inline">
            <input type="text" name="ltel" id="ltel" required  lay-verify="required" placeholder="请输入楼层" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-inline">
            <input type="text" name="lsex" id="lsex" required  lay-verify="required" placeholder="请输入房间号" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">身份证号码</label>
        <div class="layui-input-inline">
            <input type="text" name="lnativeplace" id="lnativeplace" required  lay-verify="required" placeholder="请输入房间号" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">籍贯</label>
        <div class="layui-input-inline">
            <input type="text" name="lidcard" id="lidcard" required  lay-verify="required" placeholder="请输入房间面积" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">修改时间</label>
        <div class="layui-input-block">
            <input name="laddtime" id="laddtime" type="text" class="layui-input" id="test1">
        </div>
    </div>
</form>
<script src="/static/js/jquery-3.3.1.js"></script>
<script src="/static/layui/layui.js"></script>
<script>
    //Demo
    layui.use(['form','laydate'], function() {
        var form = layui.form;
        var $ = layui.$;
        $().ready(function () {
            $.ajax({
                url: "/mainServlet?method=queryone",
                type: "get",
                dataType: "json",
                data: {"lid": getQueryString("lid")},
                success: function (da) {
                    var aaa = da.data;
                    if (da.code == 0) {
                        $.each(da.data, function (update, u) {
                            $("#lid").val(u.lid);
                            $("#lname").val(u.lname);
                            $("#ltel").val(u.ltel);
                            $("#lsex").val(u.lsex);
                            $("#lnativeplace").val(u.lnativeplace);
                            $("#lidcard").val(u.lidcard);
                            $("#laddtime").val(layui.util.toDateString(u.laddtime, 'yyyy-MM-dd'));
                            //$('#ctime').val(layui.util.toDateString(u.ctime,'yyyy-MM-dd'));
                        })
                    } else {
                        layer.msg("查询数据失败！");
                    }
                }
            })
        })
        $(function () {
            $("input").prop("disabled", "disabled");
            $("select").prop("disabled","disabled");
            // $("textarea").prop("disabled", "disabled");
        })


        //获取传来的？后的 字段参数
        function getQueryString(name) {
            var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
            var r = window.location.search.substr(1).match(reg);
            if (r != null) {
                return unescape(r[2]);
            }
            return null;
        }
    })
</script>
</body>
</html>